package ${content.serviceImpl.classPackage};

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ${content.service.classPackage}.${content.service.className};
import ${content.dao.classPackage}.${content.dao.className};
import ${content.assist.classPackage}.${content.assist.className};
import ${content.entity.classPackage}.${content.entity.className};

/**
 * ${content.entity.className}的service接口的实现类
 * 
 * @author 
 *
 */
@Service
public class ${content.serviceImpl.className} implements ${content.service.className} {

	@Autowired
	private ${content.dao.className} ${content.dao.className?uncap_first};
	
	@Override
	public long ${content.service.item.count.value!}(Assist assist){
		return ${content.dao.className?uncap_first}.${content.dao.item.count.value!}(assist);
	}
	
	@Override
	public List<${content.entity.className}> ${content.service.item.select.value!}(Assist assist){
		return ${content.dao.className?uncap_first}.${content.dao.item.select.value!}(assist);
	}
	
	@Override
	<#if content.entity.primaryKeyAttr??>
	public ${content.entity.className} ${content.service.item.selectById.value!}(${content.entity.primaryKeyAttr.javaType} id){
		return ${content.dao.className?uncap_first}.${content.dao.item.selectById.value!}(id);
	}
	</#if>
	
	@Override
	public ${content.entity.className} ${content.service.item.selectSingleByObj.value!}(${content.entity.className} obj){
		return ${content.dao.className?uncap_first}.${content.dao.item.selectSingleByObj.value!}(obj);
	}
	
	@Override
	public List<${content.entity.className}> ${content.service.item.selectListByObj.value!}(${content.entity.className} obj){
		return ${content.dao.className?uncap_first}.${content.dao.item.selectListByObj.value!}(obj);
	}

	@Override
	public int ${content.service.item.insertAll.value!}(${content.entity.className} value){
		return ${content.dao.className?uncap_first}.${content.dao.item.insertAll.value!}(value);
	}
	
	@Override
	public int ${content.service.item.insertNotNull.value!}(${content.entity.className} value){
		return ${content.dao.className?uncap_first}.${content.dao.item.insertNotNull.value!}(value);
	}
	
	@Override
	public int ${content.service.item.insertBatch.value!}(List<${content.entity.className}> value){
		return ${content.dao.className?uncap_first}.${content.dao.item.insertBatch.value!}(value);
	}
	
	@Override
	<#if content.entity.primaryKeyAttr??>
	public int ${content.service.item.deleteById.value!}(${content.entity.primaryKeyAttr.javaType} id){
		return ${content.dao.className?uncap_first}.${content.dao.item.deleteById.value!}(id);
	}
	</#if>
	
	@Override
	public int ${content.service.item.deleteByAssist.value!}(Assist assist){
		return ${content.dao.className?uncap_first}.${content.dao.item.deleteByAssist.value!}(assist);
	}
	
	@Override
	<#if content.entity.primaryKeyAttr??>
	public int ${content.service.item.updateAllById.value!}(${content.entity.className} value){
		return ${content.dao.className?uncap_first}.${content.dao.item.updateAllById.value!}(value);
	}
	
	@Override
	public int ${content.service.item.updateNotNullById.value!}(${content.entity.className} value){
		return ${content.dao.className?uncap_first}.${content.dao.item.updateNotNullById.value!}(value);
	}
	</#if>
	
	@Override
	public int ${content.service.item.updateAllByAssist.value!}(${content.entity.className} value, Assist assist){
		return ${content.dao.className?uncap_first}.${content.dao.item.updateAllByAssist.value!}(value, assist);
	}
	
	@Override
	public int ${content.service.item.updateNotNullByAssist.value!}(${content.entity.className} value, Assist assist){
		return ${content.dao.className?uncap_first}.${content.dao.item.updateNotNullByAssist.value!}(value, assist);
	}


}